<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      Introduction to Xorg-7
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;24.&nbsp;X Window System Environment
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="installing.html" title=
          "X Window System Environment">Prev</a>
          <p>
            X Window System Environment
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="util-macros.html" title=
          "util-macros-1.19.2">Next</a>
          <p>
            util-macros-1.19.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="installing.html" title=
          "Chapter&nbsp;24.&nbsp;X Window System Environment">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="xorg7" name="xorg7"></a>Introduction to Xorg-7
      </h1>
      <p>
        <span class="application">Xorg</span> is a freely redistributable,
        open-source implementation of the <span class="application">X</span>
        Window System. This system provides a client/server interface between
        display hardware (the mouse, keyboard, and video displays) and the
        desktop environment, while also providing both the windowing
        infrastructure and a standardized application interface (API).
      </p>
      <p class="usernotes">
        User Notes: <a class="ulink" href=
        "http://wiki.linuxfromscratch.org/blfs/wiki/Xorg7">http://wiki.linuxfromscratch.org/blfs/wiki/Xorg7</a>
      </p>
      <h3>
        Xorg Download and Installation Instructions
      </h3>
      <p>
        Xorg-7.0 introduced a completely auto-tooled, modular build system.
        With the new modular build system, it is no longer possible to
        download the entire package in a single file. In fact, there will be
        well over 100 packages that need to be fetched from the download
        location. To assist with such a large task, installing <a class=
        "xref" href="../basicnet/wget.html" title=
        "Wget-1.20.3">Wget-1.20.3</a> is strongly recommended for downloading
        the needed files. A complete <span class="application">wget</span>
        file list is provided for each page that includes multiple packages.
      </p>
      <p>
        Given the number of packages available, deciding which packages you
        need to install for your particular setup may seem a bit overwhelming
        at first. Take a look at <a class="ulink" href=
        "http://wiki.x.org/wiki/ModuleDescriptions">this page</a> and
        <a class="ulink" href=
        "http://lists.x.org/archives/xorg-modular/2005-November/000801.html">this
        thread</a> to get an idea of what you will need. If you are unsure,
        you should install all packages at the cost of extra disk space.
      </p>
      <div class="admon note">
        <img alt="[Note]" src="../images/note.png" />
        <h3>
          Note
        </h3>
        <p>
          Even if you intend to download only the necessary packages, you
          should download the wget file lists. The list of files are ordered
          by dependency, and the package versions listed in the files are
          known to work well with each other. Further, the wget file lists
          contain comments for specific packages that are deprecated or are
          not recommended to install. Newer packages are likely intended for
          the next release of <span class="application">Xorg</span> and have
          already proved to be incompatible with current versions of software
          installed in BLFS. The installed size of <span class=
          "application">Xorg</span> can be reduced considerably by installing
          only the packages that you will need and use, however, the BLFS
          book cannot account for all dependencies and build options for the
          individual <span class="application">Xorg</span> packages. The
          instructions assume that all packages have been built. A <a class=
          "ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/Xorg7">wiki</a> page
          containing dependency information is under development. You are
          encouraged to add to these pages if you discover additional
          information that may be helpful to other users who selectively
          install individual packages.
        </p>
      </div>
      <p>
        Additionally, because of the large number of repetitive commands, you
        are encouraged to partially automate the build. Instructions have
        been given that utilize the <a class="xref" href=
        "../postlfs/sudo.html" title="Sudo-1.8.31">Sudo-1.8.31</a> package.
        It is recommended that you use the <em class=
        "parameter"><code>:NOPASSWD</code></em> configuration option for the
        user that will be building the xorg packages.
      </p>
      <div class="sect2" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="xorg-env" name="xorg-env"></a>Setting up the Xorg Build
          Environment
        </h2>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            The following instructions assume that the shell startup files
            have been set up as described in <a class="xref" href=
            "../postlfs/profile.html" title=
            "The Bash Shell Startup Files">The Bash Shell Startup Files</a>.
          </p>
        </div>
        <p>
          First, you'll need to create a working directory:
        </p>
        <pre class="userinput">
<kbd class="command">mkdir xc &amp;&amp;
cd xc</kbd>
</pre>
        <p>
          As with previous releases of the X Window System, it may be
          desirable to install <span class="application">Xorg</span> into an
          alternate prefix. This is no longer common practice among Linux
          distributions. The common installation prefix for <span class=
          "application">Xorg</span> on Linux is <code class=
          "filename">/usr</code>. There is no standard alternate prefix, nor
          is there any exception in the current revision of the Filesystem
          Hierarchy Standard for Release 7 of the X Window System. Alan
          Coopersmith of Sun Microsystems, once stated "At Sun, we were using
          <code class="filename">/usr/X11</code> and plan to stick with it."
          Only the <code class="filename">/opt/*</code> prefix or the
          <code class="filename">/usr</code> prefix adhere to the current FHS
          guidelines.
        </p>
        <p>
          Choose your installation prefix, and set the <code class=
          "envar">XORG_PREFIX</code> variable with the following command:
        </p>
        <pre class="userinput">
<kbd class="command">export XORG_PREFIX="<em class=
"replaceable"><code>&lt;PREFIX&gt;</code></em>"</kbd>
</pre>
        <p>
          Throughout these instructions, you will use the following
          <span class="command"><strong>configure</strong></span> switches
          for all of the packages. Create the <code class=
          "envar">XORG_CONFIG</code> variable to use for this parameter
          substitution:
        </p>
        <pre class="userinput">
<kbd class=
"command">export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc \
    --localstatedir=/var --disable-static"</kbd>
</pre>
        <p>
          Create an <code class="filename">/etc/profile.d/xorg.sh</code>
          configuration file containing these variables as the <code class=
          "systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">cat &gt; /etc/profile.d/xorg.sh &lt;&lt; EOF
<code class="literal">XORG_PREFIX="$XORG_PREFIX"
XORG_CONFIG="--prefix=\$XORG_PREFIX --sysconfdir=/etc --localstatedir=/var --disable-static"
export XORG_PREFIX XORG_CONFIG</code>
EOF
chmod 644 /etc/profile.d/xorg.sh</kbd>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            There is some confustion about the above 'here' document. The
            backslash in front of the dollar sign is correct. Bash will
            remove it when creating /etc/profile.d/xorg.sh. However, if you
            are creating the file with an editor, a copy and paste operation
            will not remove the baskslash. It must then be removed manually.
          </p>
        </div>
        <p>
          If you've installed <a class="xref" href="../postlfs/sudo.html"
          title="Sudo-1.8.31">Sudo-1.8.31</a>, ensure that <code class=
          "envar">XORG_PREFIX</code> and <code class=
          "envar">XORG_CONFIG</code> are available in the <span class=
          "application">sudo</span> environment. As the <code class=
          "systemitem">root</code> user, run the following command:
        </p>
        <pre class="root">
<kbd class="command">cat &gt; /etc/sudoers.d/xorg &lt;&lt; EOF
<code class="literal">Defaults env_keep += XORG_PREFIX
Defaults env_keep += XORG_CONFIG</code>
EOF</kbd>
</pre>
        <div class="admon note">
          <img alt="[Note]" src="../images/note.png" />
          <h3>
            Note
          </h3>
          <p>
            If you've decided to use the standard <code class=
            "filename">/usr</code> prefix, you can omit the remainder of this
            page and continue at <a class="xref" href="util-macros.html"
            title="util-macros-1.19.2">util-macros-1.19.2</a>.
          </p>
        </div>
        <p>
          If you've decided to <span class="emphasis"><em>not</em></span> use
          the standard prefix, be sure to add <code class=
          "filename">$XORG_PREFIX/bin</code> to your <code class=
          "envar">PATH</code> environment variable, and <code class=
          "filename">$XORG_PREFIX/lib/pkgconfig</code> and <code class=
          "filename">$XORG_PREFIX/share/pkgconfig</code> to your <code class=
          "envar">PKG_CONFIG_PATH</code> variable. It is also helpful to
          specify additional search paths for <span class=
          "command"><strong>gcc</strong></span> and an include directory for
          the <span class="command"><strong>aclocal</strong></span> program.
          Issue the following commands as the <code class=
          "systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">cat &gt;&gt; /etc/profile.d/xorg.sh &lt;&lt; "EOF"
<code class="literal">
pathappend $XORG_PREFIX/bin             PATH
pathappend $XORG_PREFIX/lib/pkgconfig   PKG_CONFIG_PATH
pathappend $XORG_PREFIX/share/pkgconfig PKG_CONFIG_PATH

pathappend $XORG_PREFIX/lib             LIBRARY_PATH
pathappend $XORG_PREFIX/include         C_INCLUDE_PATH
pathappend $XORG_PREFIX/include         CPLUS_INCLUDE_PATH

ACLOCAL="aclocal -I $XORG_PREFIX/share/aclocal"

export PATH PKG_CONFIG_PATH ACLOCAL LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH</code>
EOF</kbd>
</pre>
        <p>
          The script above needs to be activated. Normally it will be
          automatic at login, but to activate it now, as a regular user, run:
        </p>
        <pre class="userinput">
<kbd class="command">source /etc/profile.d/xorg.sh</kbd>
</pre>
        <p>
          You should also add <code class="filename">$XORG_PREFIX/lib</code>
          to the <code class="filename">/etc/ld.so.conf</code> file. Again,
          as the <code class="systemitem">root</code> user, issue the
          following command:
        </p>
        <pre class="root">
<kbd class="command">echo "$XORG_PREFIX/lib" &gt;&gt; /etc/ld.so.conf</kbd>
</pre>
        <p>
          You should also modify <code class=
          "filename">/etc/man_db.conf</code>, adding appropriate
          MANDATORY_MANPATH, MANPATH_MAP, and MANDB_MAP entries following the
          examples for <code class="filename">/usr/X11R6</code>. Issue the
          following command as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">sed "s@<em class=
"replaceable"><code>/usr/X11R6</code></em>@$XORG_PREFIX@g" -i /etc/man_db.conf</kbd>
</pre>
        <p>
          Some applications look for shared files in <code class=
          "filename">/usr/share/X11</code>. Create a symbolic link to the
          proper location as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">ln -svf $XORG_PREFIX/share/X11 /usr/share/X11</kbd>
</pre>
        <p>
          If building KDE, some cmake files look for Xorg in places other
          than $XORG_PREFIX. Allow cmake to find Xorg with:
        </p>
        <pre class="root">
<kbd class="command">ln -svf $XORG_PREFIX /usr/X11R6</kbd>
</pre>
      </div>
      <p class="updated">
        Last updated on 2020-01-31 22:10:49 -0800
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="installing.html" title=
          "X Window System Environment">Prev</a>
          <p>
            X Window System Environment
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="util-macros.html" title=
          "util-macros-1.19.2">Next</a>
          <p>
            util-macros-1.19.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="installing.html" title=
          "Chapter&nbsp;24.&nbsp;X Window System Environment">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
